package com.ten.cotroller;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ten.pojo.Park;
import com.ten.service.ParkService;
@Controller
public class IndexController {
  @Autowired
  private ParkService parkService;
  @RequestMapping("/")
  public String index(HttpServletRequest req){
	List<Park> result =parkService.findAll();
	req.setAttribute("parks",result);
	return "index";
  }
  @RequestMapping("/add")
  public String addChe(){
	  return "add";
  }
}
